﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="m_groupmodule.ascx.cs" Inherits="administrator_uc_admin_m_groupmodule" %>
<div id="managecontent">
    <div id="managecontent_title">
        <span style="font-size:15px; font-weight:bold">Quản lý phân quyền nhóm:</span><asp:DropDownList ID="DropdownGroups" runat="server" Width="200px" onchange="javascript:GroupModuleGetValue(this);" ></asp:DropDownList>    
    </div>
    <br class="clrfix" />
    <div id="managecontent-header">
        <div id="managecontent_feature2">
             <a href="../administrator/default.aspx?mod=m_groups" title="Quay trở lại"><img src="../images/icons/icon_back.jpg" border="0px" /><b>Quay trở lại</b></a> || 
             <a href="javascript:location.reload(true);" title="Load lại trang"><img src="../images/icons/icon_reload.jpg" border="0px" /><b>Tải lại trang</b></a>      
        </div>
    </div>
    <br class="clrfix" />
    <div style="border-top:1px solid blue;">
    <table width="910px" cellpadding="0" cellspacing="0" border="0">
        <tr>
            <td style="width:30%;" valign="top">
            <h3>Danh sách module hệ thống</h3>
            <asp:Panel ID="pnlLeft" runat="server" Width="100%" Height="450px" ScrollBars="Horizontal">
            <asp:GridView ID="grvDanhSach" runat="server" DataKeyNames="ModuleID" Width="100%"
            AutoGenerateColumns="False"
            ShowHeader="true" CellPadding="3" GridLines="None">
                <Columns>
                  <asp:TemplateField>                          
                        <ItemTemplate>
                            <asp:CheckBox ID="chkCheckgvDS" runat="server" />
                            <asp:HiddenField ID="hdItemIDgvDS" runat="server" Value='<%#Bind("ModuleID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>           
                    <asp:BoundField DataField="ModuleName" HeaderText="Tên module" SortExpression="ModuleName" />
                </Columns>
                <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" 
                 Height="26px" />
                <RowStyle Height="25px" CssClass="rowStyle" />
            </asp:GridView>
            </asp:Panel>
            </td>
            <td style="width:5%;" valign="middle">
                <asp:Button ID="btnAddModule" runat="server" Text=">>" Width="100%" ToolTip="Add Module" 
                    onclick="btnAddModule_Click" /><br /><br />
                <asp:Button ID="btnRemoveModule" runat="server" Text="<<" Width="100%" ToolTip="Remove Module"
                    onclick="btnRemoveModule_Click" />
            </td>
            <td style="width:75%;" valign="top">
             <h3>Danh sách module truy cập & phân quyền</h3>
            <asp:Panel ID="pnlRight" runat="server" Width="100%" Height="450px" ScrollBars="Horizontal">
            <asp:GridView ID="grvDanhSachChon" runat="server" DataKeyNames="ModuleID" Width="100%"
            AutoGenerateColumns="False" ShowHeader="true" 
                CellPadding="3" GridLines="None" 
                    onrowcommand="grvDanhSachChon_RowCommand" 
                    onrowcreated="grvDanhSachChon_RowCreated">
                <Columns>
                     <asp:TemplateField>                        
                        <ItemTemplate>
                            <asp:CheckBox ID="chkCheckgvDSChon" runat="server" />
                            <asp:HiddenField ID="hdItemIDgvDSChon" runat="server" Value='<%#Bind("ModuleID") %>' />
                        </ItemTemplate>
                    </asp:TemplateField>           
                    <asp:BoundField DataField="ModuleName" HeaderText="Tên module" SortExpression="ModuleName" />
                    <asp:TemplateField HeaderText="Quyền truy cập">
                        <ItemTemplate>
                            <asp:DropDownList ID="DropDownListPermission" runat="server" SelectedValue='<%# Eval("PermissionNumber") %>' AppendDataBoundItems="true">
                                <asp:ListItem Value="0">---No Permission---</asp:ListItem>
                            </asp:DropDownList>
                        </ItemTemplate>
                    </asp:TemplateField>  
                    <asp:TemplateField HeaderText="Lưu cấu hình">                     
                        <ItemTemplate>
                            <asp:LinkButton ID="lbtAddUser" runat="server" CommandName="UpdatePermission" CommandArgument='<%#Bind("ModuleID") %>' CausesValidation="false" ToolTip="Cập nhật quyền">
                                <img src="../images/icons/icon_save.gif" border="0px" />
                            </asp:LinkButton>               
                        </ItemTemplate>
                    </asp:TemplateField>                
                </Columns>
                <HeaderStyle Font-Bold="True" BackColor="Silver" Font-Size="14px" 
                 Height="26px" />
                <RowStyle Height="25px" CssClass="rowStyle" />
            </asp:GridView>                     
            </asp:Panel>   
            <div style="text-align:center">
            <asp:LinkButton ID="lbtUpdateAll" runat="server" onclick="lbtUpdateAll_Click" > <img src="../images/icons/icon_Save.jpg" border="0px" /><b>Lưu Lại Tất Cả</b> </asp:LinkButton>       
            </div>         
            </td>
        </tr>
    </table>
    </div>
    <div id="AddNewItem">
        <asp:HiddenField ID="hdItemID" runat="server" />
    </div>
</div>